﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CSConsoleTest
{
    class TestLambda : BaseConsoleTest
    {
        private delegate int calc(int aArg1, int aArg2);

        public void printDescription()
        {
            Console.WriteLine("--- Lambda ---");
        }

        public void doTest()
        {
            //Lambda expression
            calc plus = (int aArg1, int aArg2) => aArg1 + aArg2;

            //Lambda type inference
            calc minus = (aArg1, aArg2) => aArg1 - aArg2;

            //Lambda statement
            calc plusAndMultiply2 = (int aArg1, int aArg2) =>
            {
                return (aArg1 + aArg2) * 2;
            };


        }
    }
}
